//
//  EnPoint.swift
//  CMCCIOTSwift
//
//  Created by isoftstone on 2017/4/19.
//  Copyright © 2017年 isoftstone. All rights reserved.
//

import UIKit
import Foundation
import Alamofire
public typealias Method        = Alamofire.HTTPMethod
public typealias EncodingType  = Alamofire.ParameterEncoding
public typealias URLEncoding = Alamofire.URLEncoding
public typealias JSONEncoding = Alamofire.JSONEncoding

public class RequestEntity<Target : RequestBaseProtocol>{
    
}
extension RequestEntity{
    public func request(target : Target ) -> Alamofire.DataRequest{
    
        let url = target.baseURL.appendingPathComponent(target.path)?.absoluteString
        debugPrintLog("RequestClass: url:\(String(describing: url)) get:\(target.method) params:\(String(describing: target.parameters)) encodeing:\(target.encoding)")
        let request = Alamofire.request(url!, method: target.method, parameters: target.parameters, encoding: target.encoding, headers: target.headers)
        return request
    }
}
